package com.hwangrq.github.login.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author hwangrq
 * @date 2021/3/20 18:53
 * @description
 */
@Configuration
public class MyWebAppConfigurer extends WebMvcConfigurerAdapter {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration interceptorRegistration = registry.addInterceptor(new RequestInterceptor());
        interceptorRegistration.addPathPatterns("/**").excludePathPatterns("/login/**", "/error");
        super.addInterceptors(registry);
    }
}
